package com.qf.limit.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.limit.entity.Friendrequest;
import com.qf.limit.entity.vo.FriendRequestVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (Friendrequest)表数据库访问层
 *
 * @author makejava
 * @since 2024-09-13 12:48:10
 */
public interface FriendrequestDao extends BaseMapper<Friendrequest> {

    @Select("SELECT fr.id, fr.from_id, u.header, u.nickname, fr.info, fr.create_time," +
            " fr.status FROM friendrequest " +
            "fr JOIN user u ON fr.from_id = u.id WHERE fr.to_id = #{uid} " +
            "ORDER BY fr.create_time DESC")
    List<FriendRequestVo> queryMeRequest(Integer uid);

}

